import request from '@/utils/request'

// 获取个人信息
export const getUserInfo = (id) => {
    return request.get('/web/user/getUserInfo/' + id)
}

// 修改个人信息
export const updateUserInfo = (userInfo) => {
    return request.put('/web/user/updateUserInfo', userInfo)
}

// 获取我的粉丝信息
export const getMyFansInfo = (page, size, userId) => {
    return request.get('/web/user/getMyFans?page=' + page + '&size=' + size + '&userId=' + userId)
}

// 获取我的关注信息
export const getMyFollowersInfo = (page, size, userId) => {
    return request.get('/web/user/getMyFollowers?page=' + page + '&size=' + size + '&userId=' + userId)
}

// 获取我的评论信息
export const getMyCommentsInfo = (page, size, userId) => {
    return request.get('/web/user/getMyComments?page=' + page + '&size=' + size + '&userId=' + userId)
}

// 关注接口
export const follow = (followedUserId) => {
    return request.post('/web/user/followed', {
        followedUserId: followedUserId,
    })
}

// 取消关注接口
export const cancelFollow = (followedUserId) => {
    return request.put('/web/user/cancelFollow', { followedUserId: followedUserId })
}
